
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html; UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>教师管理</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"/>
    <script src="${pageContext.request.contextPath}/back/statics/js/jquery-1.8.3.min.js"></script>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>


<script>
    // 修改模块
    function change_teacher(teaid)
    {



        var password=$.trim($("#password").val());
        var phone=$.trim($("#phone").val());

        var teaid=teaid;



        $.ajax(
            {
                url: "${pageContext.request.contextPath}/teacher/changeTea",
                // data:{form_data:form_data,act:act},
                data:{teaid:teaid,password:password,phone:phone},
                type: "post",
                beforeSend:function()
                {
                    $("#tip").html("<span style='color:blue'>正在处理...</span>");
                    return true;
                },
                success:function(data)
                {
                    var msg = "修改";
                    $("#tip").html("<span style='color:blueviolet'>" +msg+ "成功！</span>");
                    alert("工号为："+teaid+"的信息"+msg + "成功");
                    location.reload();

                },
                error:function()
                {
                    alert('请求出错');
                },
                complete:function()
                {
                    $('#acting_tips').hide();
                }
            });

        return false;
    }
</script>
<body>
<div   style="font-size: 30px; text-align: center; margin-top: 20px ">
    <label >个人信息中心</label></div>
<div class="container"  style="margin-top: 30px">
    <div class="row">
        <div class="col-md-12">
            <div class="row"><div class="col-md-12" >
                <label style="font-size: 20px; text-align: center"></label>
                <div class="margin:0 15px" style="overflow-x: scroll;"><table  style="overflow:scroll; border-color: black; border-style: dotted;" class="table table-striped table-hover animated fadeIn">

                    <thead>
                    <tr>
                        <td>个人信息栏</td>
                        <td>信息</td>
                        <td>介绍</td>
                    </tr>
                    </thead>
                    <tr>
                        <td>工号</td>
                        <td>${teacher.teaid}</td>
                        <td>教师信息唯一标示</td>
                    </tr>

                    <tr>
                        <td>姓名</td>
                        <td>${teacher.name}</td>
                        <td>不可修改</td>
                    </tr>

                    <tr>
                        <td>密码</td>
                        <td>${teacher.password}</td>
                        <td>可修改</td>
                    </tr>

                    <tr>
                        <td>性别</td>
                        <td>${teacher.sex}</td>
                        <td>不可修改</td>
                    </tr>
                    <tr>
                        <td>手机号码</td>
                        <td>${teacher.phone}</td>
                        <td>可修改</td>
                    </tr>


                    <tr>
                        <td>部门</td>
                        <td>${teacher.depart}</td>
                        <td>不可修改</td>
                    </tr>


                    <tr>
                        <td></td>
                        <td>

                            <form method="post" action="" class="form-horizontal" role="form" id="form_data" onsubmit="return change_teacher(${teacher.teaid})" style="margin: 20px;">
                                <div class="modal fade" id="addUserModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                                    &times;
                                                </button>
                                                <h4 class="modal-title" id="myModalLabel">
                                                    修改信息
                                                </h4>
                                            </div>
                                            <div class="modal-body">
                                                <form class="form-horizontal" role="form" title="${teacher.teaid}">
                                                    <div class="form-group">
                                                        <label for="password" class="col-sm-3 control-label">密码</label>
                                                        <div class="col-sm-9">
                                                            <input type="text" class="form-control" id="password" name="password" value="${teacher.password}"
                                                                   placeholder="请输入新密码">
                                                        </div>
                                                    </div>


                                                    <div class="form-group">
                                                        <label for="phone" class="col-sm-3 control-label">手机号码</label>
                                                        <div class="col-sm-9">
                                                            <input type="text" class="form-control" name="phone" value="${teacher.phone}" id="phone"
                                                                   placeholder="请输入手机号码" >
                                                        </div>
                                                    </div>





                                                </form>
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                                </button>
                                                <button type="submit" class="btn btn-primary">
                                                    提交
                                                </button><span id="tip"> </span>
                                            </div>
                                        </div><!-- /.modal-content -->
                                    </div><!-- /.modal -->
                                </div>

                            </form>



                            <button id="add" class="btn btn-success"  type="button" data-toggle="modal"  data-target="#addUserModal2">修改信息</button></td>
                        <td></td>
                    </tr>


                </table></div></div></div>
        </div>
    </div>
</div>

</html>